<script setup>
// 在Vue3 CompositionAPI中
// 1. 获取路由对象router useRouter
//   const router =useRouter()
// 2. 获取路由参数route  useRoute
//   const route = useRoute()
import { useRouter, useRoute } from 'vue-router'
const route = useRoute()
const router = useRouter()
const goList = () => {
  router.push('/list')
  console.log(route, router)
}
</script>

<template>
  <div>我是App</div>
  <button @click="$router.push('/home')">跳首页</button>
  <button @click="goList">跳列表页</button>
</template>

<style scoped></style>
